<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .father {
      width: 300px;
      height: 300px;
      background-color: skyblue;
    }

    .father::before {
      /* 必加的属性 */
      content: '我是一个伪元素';
      /* 伪元素默认是行内元素 */
      /* 想要设置宽高必须转换显示方式为行内块元素或块元素 */
      display: block;
      width: 100px;
      height: 100px;
      background-color: orange;
    }

    /* .father::after {
      content: '我是一个伪元素';
      display: block;
      width: 100px;
      height: 100px;
      background-color: orange;
    } */
  </style>
</head>

<body>
  <div class="father">我是father中的内容</div>
</body>

</html>